package com.ybb.common.configuration;

import com.ybb.common.configuration.response.RetResponse;
import com.ybb.common.configuration.response.RetResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

@ControllerAdvice
public class GlobalExceptionHandler {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public RetResult<Object> handler1(Exception e){
        e.printStackTrace();
        return RetResponse.makeErrRsp(e.getMessage());
    }
}